package _2实例内部类;

// 外部类
public class Outter {

	String name = "Outter name";

	public void foo() {
		System.out.println("Outter.foo()");
		String name = "tmp name1";
		System.out.println(name);
		System.out.println(this.name);

//		System.out.println(age);//无法访问
	}

	// 内部类
	public class Inner {
		String name = "Inner name";
		// 不能定义static
		// static int age;

		public void foo2() {
			System.out.println("Inner.foo2()");
			String name = "temp name2";
			System.out.println(this.name);
			System.out.println(Outter.this.name);
		}
	}

}
